package cn.iocoder.yudao.module.infra.dal.dataobject.ocr;

import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;

import java.math.BigDecimal;

/**
 * OCR Recognition Record Data Object
 * Stores OCR recognition history and results
 *
 * @author yudao
 */
@TableName("infra_ocr_record")
@KeySequence("infra_ocr_record_seq") // For Oracle, PostgreSQL, Kingbase, DB2, H2 database primary key auto
                                     // increment. MySQL can omit this.
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class OcrRecordDO extends BaseDO {

    /**
     * Record ID, database auto increment
     */
    private Long id;

    /**
     * Configuration ID
     * 
     * Related to {@link OcrConfigDO#getId()}
     */
    private Long configId;

    /**
     * File ID
     * 
     * Related to file upload record
     */
    private Long fileId;

    /**
     * File URL
     */
    private String fileUrl;

    /**
     * Original file name
     */
    private String fileName;

    /**
     * OCR type (general_basic, accurate_basic, etc.)
     */
    @TableField("ocr_type")
    private String ocrType;

    /**
     * Recognition result text
     */
    @TableField("recognition_text")
    private String recognitionText;

    /**
     * Complete recognition result (JSON format)
     */
    @TableField("recognition_result")
    private String recognitionResult;

    /**
     * Recognition confidence (0.0000-1.0000)
     */
    private BigDecimal confidence;

    /**
     * Processing time (milliseconds)
     */
    @TableField("processing_time")
    private Integer processingTime;

    /**
     * Processing status (0: processing, 1: success, 2: failed)
     */
    private Integer status;

    /**
     * Error message
     */
    @TableField("error_message")
    private String errorMessage;

    /**
     * User ID
     */
    @TableField("user_id")
    private Long userId;

    // 非数据库字段，用于前端显示
    @TableField(exist = false)
    private String configName;

    @TableField(exist = false)
    private String imageUrl;

}